<template>
  <div class="questionTypes">
    <div v-if="form.type == 1"
         class="select">
      <div class="selectItem"
           v-for="(item, index) in form.select_options"
           :key="index">
        <el-radio :label="item.label"
                  v-model="form.single_select_answer"></el-radio>
        <el-input v-model="item.text"></el-input>
        <Picture v-model="item.image"></Picture>
      </div>
    </div>
    <div v-else-if="form.type == 2"
         class="select">
      <div class="selectItem"
           v-for="(item, index) in form.select_options"
           :key="index">
        <el-checkbox :label="item.label"
                     v-model="form.multiple_select_answer"></el-checkbox>
        <el-input v-model="item.text"></el-input>
        <Picture v-model="item.image"></Picture>
      </div>
    </div>
    <div v-else>
      <el-input v-model="form.short_answer"
                type="textarea"
                :rows="4"></el-input>
    </div>
  </div>
</template>

<script>
export default {
  name: 'questionTypes',
  props: {
    form: {
      type: Object,
      required: true
    }
  },
  data () {
    return {
      image: process.env.VUE_APP_BASE_API + this
    }
  }
}
</script>

<style lang="less">
.selectItem {
  display: flex;
  align-items: center;
}
</style>
